var express = require('express');
var router = express.Router();

/* GET home page. */
router.get('/', function (req, res, next) {
    res.locals.title = 'Express';
    res.render('index');
});

router.get(/^\/commits\/(\w+)(?:\.\.(\w+))?$/, function(req, res){
    var from = req.params[0];
    var to = req.params[1] || 'HEAD';
    res.send('commit range ' + from + '..' + to);
});

router.get('/user/:id', function(req, res,next){
    var from = req.params['id'];
    //var to = req.params[1] || 'HEAD';
    res.send('commit range ' + from );
    next();
});



router.get('/index', function (req, res, next) {
    res.send('index');
    //next();
});

module.exports = router;
